package com.zhu.library_management_system.responseMessage;


import lombok.Data;
import org.springframework.http.HttpStatus;

@Data
public class ResponseMessage<T> {

    private int status;
    private String message;
    private T data;
    public ResponseMessage(int status, String message, T data) {
        this.status = status;
        this.message = message;
        this.data = data;
    }
    public static <T> ResponseMessage<T> success(T data) {
        return new ResponseMessage(HttpStatus.OK.value(), "success", data);
    }

    public static <T> ResponseMessage<T> success(int status ,String message, T data) {
        return new ResponseMessage(status, message, data);
    }



}
